<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>

<head>
<meta charset="utf-8" />
<title></title>
<!----导入bootstrap的外部css文件---->
<link href="${basePath}bootstrap-3.3.7-dist/css/bootstrap.min.css"
	rel="stylesheet">
<link href="${basePath}bootstrap-3.3.7-dist/css/style.css"
	rel="stylesheet">
<link href="${basePath}bootstrap-3.3.7-dist/css/bootstrap-theme.min.css"
	rel="stylesheet" />
<!----导入bootstrap的依赖的jquery文件---->
<script src="${basePath}bootstrap-3.3.7-dist/js/jquery.min.js"></script>
<!----导入bootstrap的外部javascript文件---->
<script src="${basePath}bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
<style>
/*主体div*/
#container {
	/*相对于body，主体框架居中*/
	margin: 0px auto;
	width: 1000px;
}
</style>


<script>
	function checkMe() {
		var isOK = true;
		var txtname = $("#adminName").val();
		if (txtname == null || txtname == "") {
			$("#namemsg").html("*请输入用户名");
			isOK = false;
		} else {
			$("#namemsg").html("");
		}

		// 验证非空密码			
		var txtpassword = document.getElementById("adminPsw").value;
		if (txtpassword == null || txtpassword == "") {
			document.getElementById("passwordmsg").innerHTML = "*请输入密码";
			isOK = false;
		} else {
			document.getElementById("passwordmsg").innerHTML = "";
		}

		// 验证非空邮箱			
		var txtemail = document.getElementById("adminMail").value;
		// 验证邮箱合法性的正则表达式
		var regEmail = /^\w+@\w+.[A-Za-z]{2,3}(.[A-Za-z]{2,3})?$/;
		// 验证内容是否合法，并进行相关信息提示
		if (txtemail == null || txtemail == "") {
			// 验证不通过，提示错误信息
			document.getElementById("emailmsg").innerHTML = "*请输入邮箱";
			// 验证不通过，修改验证结果的变量，不允许提交表单
			isOK = false;
		} else if (regEmail.test(txtemail) == false) {
			// 使用正则表达式
			// 验证邮箱的合法性
			document.getElementById("emailmsg").innerHTML = "*输入邮箱格式非法";
			// 验证不通过，修改验证结果的变量，不允许提交表单
			isOK = false;
		} else {
			// 验证通过，剔除提示信息
			document.getElementById("emailmsg").innerHTML = "";
		}
		
		return isOK;

	}
</script>


</head>

<body>
	<div id="container">
		<form class="form-horizontal" action="${basePath}AdminInfoAddServlet"
			method="post" enctype="multipart/form-data">
			<div class="form-group">
				<input type="hidden" id="adminId" name="adminId"
					value="${modifyAdminB.adminId }">
			</div>
			<div class="form-group">
				<label for="inputEmail3" class="col-sm-2 control-label">用户名</label>
				<div class="col-sm-4">
					<input type="text" class="form-control" id="adminName"
						name="adminName" value="${modifyAdminB.adminName }"
						placeholder="用户名">
					<td width="44%" class="indent"><font color="red" id="namemsg"></font></td>
				</div>

				<label for="inputEmail3" class="col-sm-2 control-label">密码</label>
				<div class="col-sm-4">
					<input type="password" class="form-control" id="adminPsw"
						name="adminPsw" value="${modifyAdminB.adminPsw }" placeholder="密码">
					<td class="indent"><font color="red" id="passwordmsg"></font></td>
				</div>
			</div>
			<div class="form-group">
				<label for="inputEmail3" class="col-sm-2 control-label">邮箱</label>
				<div class="col-sm-4">
					<input type="text" class="form-control" id="adminMail"
						name="adminMail" value="${modifyAdminB.adminMail }"
						placeholder="邮箱">
					<td class="indent"><font color="red" id="emailmsg"></font></td>
				</div>

				<label for="inputEmail3" class="col-sm-2 control-label">电话</label>
				<div class="col-sm-4">
					<input type="text" class="form-control" id="adminTel"
						name="adminTel" value="${modifyAdminB.adminTel }" placeholder="电话">
				</div>
			</div>
			<div class="form-group">
				<label for="inputEmail3" class="col-sm-2 control-label">出生日期</label>
				<div class="col-sm-4">
					<input type="date" class="form-control" id="adminBirthday"
						name="adminBirthday" value="${modifyAdminB.adminBirthday }"
						placeholder="出生日期">
				</div>

				<label for="inputEmail3" class="col-sm-2 control-label">头像</label>
				<div class="col-sm-4">
					<input type="file" class="form-control" id="adminImg"
						name="adminImg" placeholder="头像">
				</div>
			</div>

			<div class="form-group">
				<div class="col-sm-offset-4 col-sm-10">
					<button type="submit" class="btn btn-default"
						onclick="return checkMe();">保存</button>
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					<button type="reset" class="btn btn-default">重置</button>
				</div>
			</div>
		</form>

	</div>
</body>

</html>